<!DOCTYPE html >
<html xmlns:th="http://www.thymeleaf.org">
<head th:include="base :: header (title='派工中心')" />
<link th:href="@{plugins/common/css/basemessage.css}" rel="stylesheet" />
<link th:href="@{css/Production/pies.css}" rel="stylesheet" />
<body class="">
	<div class="main-content blank_bg">
		<div>
			<div>
				<div class="row" style="">
					<div>
						<div class="div_bg">
							<!-- 调用Production/productionPublic里的queryList，查询行 -->
								<div th:include="Production/productionPublicCol :: queryListNew" />
							
							<!-- 生产任务表 start -->
							<div style="margin-top: 5px;">
								<table id="taskTable" class="table dataTable table-hover">
								</table>
							</div>
							<!-- 生产任务表 end -->
						</div>
						
						<!-- 产品工艺路线显示表 start -->
						<div class="div_bg" style="width: 100%;margin-top: 15px;">
						    <div th:include="Production/productionPublicCol :: queryListnewProcess" />
							<span style="margin-bottom: 10px;margin-top: 5px;" class="titleX">产品工艺路线</span>
							<div id="newProcess">
								<table id="newProcessTable" class="table dataTable table-hover" style="word-break:break-all; word-wrap:break-all;">
								</table>
							</div>
						</div>
						<!-- 产品工艺路线显示表 end -->
						
						<!-- 派工模态框 start -->
						<div class="modal fade " id="dispatchingModal" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="background-color: rgba(0, 0, 0, 0.5)" data-backdrop="static">
							<div class="modal-dialog" style="width: 800px; height: 220px;">
								<div class="modal-content" style="width: auto;">
									<div class="modal-header">
										<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
										<h4 class="modal-title" id="titleModal">派工</h4>
									</div>
									<div class="modal-body" style="height: auto; padding: 10px;">
										<form id="dispatchingForm" class="form-group">
											<div style="display: inline-block;overflow: hidden;margin-right: 15px;" id="">
												<table border="0" cellspacing="0" cellpadding="0" class="table-condensed normal-table table-content" id="">
													<tr>
														<td class="title"><span class="sub">生产任务单：</span></td>
														<td colspan="2">
															<input type="text" id="dispatchingfBillNo" name="fBillNo" class="clean_c form-control" readonly="readonly">
															<input type="hidden" id="dispatchingfIcmoId" name="fIcmoId" class="clean_c form-control" readonly="readonly">
														</td>
														<td class="title"><span class="sub">排程计划时间：</span></td>
														<td colspan="2"><input type="text" id="dispatchingfPlanDate" name="fPlanDate" class="clean_c form-control" readonly="readonly"></td>
													</tr>
													<tr>
														<td class="title"><span class="sub">产品名称：</span></td>
														<td colspan="2"><input type="text" id="dispatchingfName" name="fName" class="clean_c form-control" readonly="readonly"></td>
														<td class="title"><span class="sub">产品代码：</span></td>
														<td colspan="2"><input type="text" id="dispatchingfNumber" name="fNumber" class="clean_c form-control" readonly="readonly"></td>
													</tr>
													<tr>
														 <td class="title"><span class="sub">规格型号：</span></td>
														<td colspan="2"><input type="text" id="dispatchingfModel" name="fModel" class="clean_c form-control" readonly="readonly"></td>
													</tr>
													<tr>
														<td class="title"><span class="sub">工序号：</span></td>
														<td><input type="text" id="dispatchingfOperSN" name="fOperSN" class="clean_c form-control" readonly="readonly"></td>
														<td class="title"><span class="sub">工序名称：</span></td>
														<td><input type="text" id="dispatchingfOperName" name="fOper" class="clean_c form-control" readonly="readonly"></td>
														<td class="title"><span class="sub">工作中心：</span></td>
														<td>
															<input type="text" id="dispatchingfDepName" name="fDepName" class="clean_c form-control" readonly="readonly">
															<input type="hidden" id="dispatchingfDepid" name="fDepid" class="clean_c form-control" readonly="readonly">
														</td>
													</tr>
													<tr>
														<td class="title"><span class="sub">设备组：</span></td>
														<td>
															<input type="text" id="dispatchingfMacGroupName" name="fMacGroupName" class="clean_c form-control" readonly="readonly">
															<input type="hidden" id="dispatchingfMacGroupId" name="fMacGroupId" class="clean_c form-control" readonly="readonly">
														</td>
														<td class="title"><span class="sub">是否外协：</span></td>
														<td><input type="text" id="dispatchingfIsOut" name="fIsOut" class="clean_c form-control" readonly="readonly"></td>
														<td class="title"><span class="sub">剩余可派工：</span></td>
														<td><input type="text" id="dispatchingnoDispatchQty" name="noDispatchQty" class="clean_c form-control" readonly="readonly"></td>
													</tr>
													<tr>
														<td class="title"><span class="sub">加工说明：</span></td>
														<td colspan="5"><input type="text" id="dispatchingfNote" name="fNote" class="clean_c form-control" readonly="readonly"></td>
													</tr>
													<tr>
														<td class="title"><span class="sub">定额：</span></td>
														<td colspan="4"><input type="text" id="dispatchingfPieceRate" name="fPieceRate" class="clean_c form-control" readonly="readonly" ></td>
														<td ><!-- <button type="button" class="btn btn-default" id="modifyding" style="width:80px;" >修改定额</button> --></td>
													</tr>
													<tr>
														<td class="title"><span class="sub"><span class="requiredCss">*</span>派工数量：</span></td>
														<td><input type="text" id="dispatchingfTargetQty" name="fTargetQty" class="clean_c form-control bj_color" autocomplete="off"><!--  onkeyup="if(isNaN(value))execCommand('undo')" onafterpaste="if(isNaN(value))execCommand('undo')" --></td>
														<td class="title"><span class="sub"><span class="requiredCss">*</span>开工时间：</span></td>
														<td><input type="text" id="dispatchingfStartTime" name="fStartTime" class="clean_c form-control bj_color noPass" autocomplete="off"></td>
														<td class="title"><span class="sub"><span class="requiredCss">*</span>完工时间：</span></td>
														<td><input type="text" id="dispatchingfEndTime" name="fEndTime" class="clean_c form-control bj_color noPass" autocomplete="off"></td>
													</tr>
													<tr>
														<td class="title"><span class="sub"><span class="requiredCss">*</span>设备：</span></td>
														<!-- 下拉框默认向上弹出，class里加dropup，标签里加data-dropup-auto="false" -->
														<td colspan="2"><select name="fMacId" id="dispatchingfMacId" class="selectpicker dropup clean_c" data-live-search="true" data-width="100%" data-style="btn-success" data-dropup-auto="false"></select></td>
														<td class="title" colspan="3">
															<span class="sub"><span class="requiredCss">*</span>定额折扣：</span>
															<input type="text" id="fDiscountPieceRate" name="fDiscountPieceRate" class="clean_c form-control bj_color" style="width: 110px !important;" autocomplete="off" > <!-- onkeyup="if(isNaN(value))execCommand('undo')" onafterpaste="if(isNaN(value))execCommand('undo')" -->
															<span class="">%</span>
															<span class="sub">是否工序入库：</span>
															<label style="line-height: 26px;margin-bottom: 0;">
																<input name="fIsOperInStock" type="checkbox" value="1" id="dispatchingfIsOperInStock" style="width: auto !important;vertical-align: middle;margin: -2px 2px 0 0;">是
															</label>
														</td>
													</tr>
													<tr style="display: none;" id="showCheckBox">
														<td class="title"><span class="sub">是否领料：</span></td>
														<td style="">
															<label style="line-height: 26px;margin-bottom: 0;">
																<input name="fIsOutStock" type="checkbox" value="1" id="dispatchingfIsOutStock" style="width: auto !important;vertical-align: middle;margin: -2px 2px 0 0;">是
															</label>
														</td>
														<td class="title"><span class="sub">齐套数：</span></td>
														<td><input type="text" id="qitaos"  class="clean_c form-control bj_color" readonly="readonly"></td>
														<td class="title" id="kunshow" style="display:none;"><span class="sub">库存：</span></td>
														<td><input type="text" id="worksnumber"  class="clean_c form-control bj_color" readonly="readonly" style="display:none;"></td>
													</tr>
													<tr>
														<td class="title"><span class="sub">备注：</span></td>
														<td colspan="5"><input type="text" id="dispatchingfNotess" name="fNotess" class="clean_c form-control" readonly="readonly"></td>
													</tr>
													<tr>
														<td class="title"><span class="sub">摘要：</span></td>
														<td colspan="5"><input type="text" id="dispatchingfExplanationss" name="fExplanationss" class="clean_c form-control" readonly="readonly"></td>
													</tr>
												</table>
												<div style="width: 100%;">
													<div>
														<span style="padding-left: 17px;" class="requiredCss">注：带*为必填字段。</span>
													</div>
													<div style="text-align: center;margin-top: 10px;">
														<button type="button" class="btn btn-default" id="confirm" style="margin-right: 20px;">确定</button>
														<button type="button" class="btn btn-default" id="cancel" data-dismiss="modal">取消</button>
													</div>
												</div>
											</div>
										</form>
									</div>
								</div>
							</div>
						</div>
						<!-- 派工模态框 end -->
						<!--  定额数量修改模态框 start -->
						<div class="modal fade " id="dingeninputCardModal" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="background-color: rgba(0, 0, 0, 0.5)" data-backdrop="static">
							<div class="modal-dialog" style="width: 80%; height: 220px;">
								<div class="modal-content" style="width: auto;text-align:center;">
									<div class="modal-header">
										<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
										<h4 class="modal-title" id="titleModal">定额数量修改</h4>
									</div>
									<div class="modal-body" style="padding: 10px;">
											<form id="indingForm" class="form-group">
											<div style="margin-right: 15px;" id="">
												<div style="margin-top: 5px;">
														<table id="daodingTable" class="table dataTable table-hover">
														</table>
													</div>
												<div style="width: 100%;position:relative;">
													<div style="text-align: center;margin-top: 12px;">
														<button type="button" class="btn btn-default" id="confirmmodify" style="margin-right: 20px;">确定修改</button>
														<button type="button" class="btn btn-default" id="cancel" data-dismiss="modal">取消</button>
													</div>
												</div>
											</div>
										</form>
										</div>
									</div>
								</div>
						</div>
						<!-- 定额数量修改模态框 end-->  
						<!-- 修改设备模态框 start -->
						<div class="modal fade " id="modifyModal" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="background-color: rgba(0, 0, 0, 0.5)" data-backdrop="static">
							<div class="modal-dialog" style="width: 800px; height: 220px;">
								<div class="modal-content" style="width: auto;">
									<div class="modal-header">
										<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
										<h4 class="modal-title" id="titleModal">派工设备修改</h4>
									</div>
									<div class="modal-body" style="height: auto; padding: 10px;">
										<div style="margin-bottom: 5px;">
											<div style="float:left">
												<span class="spanCss">派工单号：</span> 
												<input type="text" id="modifyfCode" name="fCode" class="form-control clean-M" style="width: 150px; margin-right: 10px;" /> 
											</div>
											<div style="float:left">
												<span class="spanCss">设备名称：</span>
												<select name="modifyDdevice" id="modifyDdevice" class="selectpicker clean_M " data-live-search="true" data-width="auto">
												</select>
											</div>
											<div style="float:left">
												<button id="query_modify" class="btn btn-default " type="button" style="margin-left: 10px;">查询</button>
												<button type="button" class="btn btn-default " id="resetting_modify">重置</button>
											</div>
											<div style="clear:both"></div>
										</div>
										<div style="">
											<table id="piesTable" class="table dataTable table-hover tableList" style="">
											</table>
										</div>
										<div>
											<span class="requiredCss">注：选择设备即可保存！</span>
										</div>
									</div>
								</div>
							</div>
						</div>
						<!-- 修改设备模态框 end -->
						<div class="modal fade " id="setout" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="background-color: rgba(0, 0, 0, 0.5)" data-backdrop="static">
							<div class="modal-dialog" style="width: 760px; height: 220px;">
								<div class="modal-content" style="width: auto;">
									<div class="modal-header">
										<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
										<h4 class="modal-title" id="myModalLabel">委外转出</h4>
									</div>
									<div class="modal-body" style="height: auto; padding: 10px;">
										<form id="inOutForm" class="form-group">
											<table border="0" cellspacing="0" cellpadding="0" class="table-condensed normal-table short-table" style="width: 710px !important;margin: 5px 15px;">
												<tr>
													<td style="width: 110px;"><span>工序代码：</span></td>
													<td style="width: 180px;">
														<input type="text" id="fOperNumber" name="fOperNumber" class="clean_c form-control" readonly="readonly" />
													</td>
													<td style="width: 110px;"><span>工序名称：</span></td>
													<td style="width: 180px;">
														<input type="text" id="fOperName" name="fOperName" class="clean_c form-control" readonly="readonly" />
													</td>
												</tr>
												<tr>
													<td><span>物料代码：</span></td>
													<td>
														<input type="text" id="fItemId" name="fItemId" class="clean_c form-control" readonly="readonly" />
													</td>
													<td><span>物料名称：</span></td>
													<td>
														<input type="text" id="wlName" name="wlName" class="clean_c form-control" readonly="readonly" />
													</td>
												</tr>
												<tr id="outNum">
													<td><span>可转出数量：</span></td>
													<td>
														<input type="text" id="num" name="num" class="clean_c form-control" readonly="readonly" />
													</td>
													<td><span class="requiredCss">*</span><span>委外数量：</span></td>
													<td>
														<input type="text" id="fQty" name="fQty" class="clean_c form-control bj_color" autocomplete="off" onkeyup="if(isNaN(value))execCommand('undo')" onafterpaste="if(isNaN(value))execCommand('undo')" />
													</td>
												</tr>
												<tr>
													<td><span id="companyID">加工单位ID：</span></td>
													<td>
														<input type="text" id="fSupplierID" name="fSupplierID" class="clean_c form-control" readonly="readonly" />
													</td>
													<td><span class="requiredCss">*</span><span id="companyName">加工单位：</span></td>
													<td>
														<input type="text" id="fSupplierName" name="fSupplierName" class="clean_c form-control bj_color" autocomplete="off" />
													</td>
												</tr>
												<tr id="outDate">
													<td><span>单价：</span></td>
													<td>
														<input type="text" id="price" name="price" class="clean_c form-control bj_color" autocomplete="off" onkeyup="if(isNaN(value))execCommand('undo')" onafterpaste="if(isNaN(value))execCommand('undo')" />
													</td>
													<td><span class="requiredCss">*</span><span>交货日期：</span></td>
													<td>
														<input type="text" id="fFetchDate" name="fFetchDate" class="clean_c form-control bj_color" autocomplete="off" />
													</td>
												</tr>
												<tr id="outPerson">
													<td><span class="requiredCss">*</span><span>转出人ID：</span></td>
													<td>
														<input type="text" id="empCardNoOut" name="empCardNo" class="clean_c form-control bj_color" autocomplete="off" />
													</td>
													<td><span>转出人：</span></td>
													<td>
														<input type="text" id="turnOutP" name="turnOutP" class="clean_c form-control" readonly="readonly" />
													</td>
												</tr>
												<tr>
													<td colspan="4" style="text-align: left;">
														<span style="color: red;padding-left: 25px;" id="content">
														注：带*为必填字段。选加工单位后，加工单位ID里才有数据！输入转出人ID按回车后，才会显示转出人姓名！
														</span>
													</td>
												</tr>
												<tr>
													<td colspan="4" style="text-align: center;">
														<div style="">
															<button type="button" class="btn btn-default" id="confirm_out" style="margin-right: 20px;">确定</button>
															<button type="button" class="btn btn-default" id="cancel" data-dismiss="modal">取消</button>
														</div>
													</td>
												</tr>
											</table>
										</form>
									</div>
								</div>
							</div>
						</div>
						<!--  改制数量模态框 start -->
						<div class="modal fade " id="gainumbermodal" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="background-color: rgba(0, 0, 0, 0.5)" data-backdrop="static">
						<div class="modal-dialog" style="width: 20%; height: 320px;">
							<div class="modal-content" style="width: auto;text-align:center;">
								<div class="modal-header">
									<h4 class="modal-title" id="titleModal" style="text-align: left;">改制</h4>
								</div>
								<div class="modal-body" style="padding: 10px;">
										<form id="inForm" class="form-group">
											<div class="row" style="height:100px;">
													<div class="col-sm-6 col-md-6 divClassLeft div_bg" style="width:100%;">
													  <div style="height:30px;">
													    <span style="line-height: 26px;">改制数量：</span>
														<input id="gainumber" type="text" class="form-control clean_c" style="width: 200px;margin-right: 15px;"/>
													  </div>
													<div style="width: 100%;">
														<div style="text-align: center;margin-top: 29px;">
															<button type="button" class="btn btn-default" id="gainumberconfirm" >确定</button>
															<button type="button" class="btn btn-default" id="cancel" data-dismiss="modal">取消</button>
														</div>
													</div>
										</div>
										</div>
									</form>
									</div>
								</div>
							</div>
						</div>
						<!-- 改制数量模态框 end       -->  
						<!--  改制模态框 start -->
						<div class="modal fade " id="inputCardModal" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="background-color: rgba(0, 0, 0, 0.5)" data-backdrop="static">
						<div class="modal-dialog" style="width: 80%; height: 320px;">
							<div class="modal-content" style="width: auto;text-align:center;">
								<div class="modal-header">
									<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
									<h4 class="modal-title" id="titleModal" style="text-align: left;">改制</h4>
								</div>
								<div class="modal-body" style="padding: 10px;">
										<form id="inForm" class="form-group">
											<div class="row" >
													<div class="col-sm-6 col-md-6 divClassLeft div_bg" style="width:70%;">
													<!-- <div class="col-sm-12 col-md-12 "> -->
														<div class="col-sm-12 col-md-12" style="margin: 0 0 5px 0;padding: 0;">
														  <div style="height:30px;float:left;">
														    <span style="float: left;line-height: 26px;">任务单号：</span>
															<input id="fbillno" type="text" class="form-control clean_c" style="float: left;width: 200px;margin-right: 15px;"/>
															<span style="float: left;line-height: 26px;">产品代码：</span>
															<input id="fNumber" type="text" class="form-control clean_c" style="float: left;width: 200px;margin-right: 15px;"/>
														  </div>
														  <div style="height:30px;float:left;">
															<span style="float: left;line-height: 26px;">产品名称：</span>
															<input id="fName" type="text" class="form-control clean_c" style="float: left;width: 200px;margin-right: 15px;"/>
															<span style="float: left;line-height: 26px;">规格型号：</span>
															<input id="fModel" type="text" class="form-control clean_c" style="float: left;width: 200px;margin-right: 15px;"/>
														   </div>	
															<button type="button" class="btn btn-default " id="cx" style="margin-right: 5px;">查询</button>
															<button type="button" class="btn btn-default " id="cz">重置</button>
														</div>
														<div>
															<!-- 产品列表 -->
															<table id="gaiTable" class="table dataTable table-hover"></table>
														</div>
													</div>
													<div class="col-sm-6 col-md-6 divClassRight div_bg" style="width:30%;">
													    <div class="col-sm-12 col-md-12" style="margin: 0 0 5px 0;padding: 0;">
														  <div style="height:60px;float:left;width:100%;">
															<input id="fnotess" type="text" class="form-control clean_c" style="float: left;width:100%;height:60px;margin-right: 15px;" placeholder="点击工序,显示加工说明"/>
														  </div>
														</div>
														<div id="ryShow">
															<div>
																<!-- 工序列表 -->
																<table id="xuTable" class="table dataTable table-hover"></table>
															</div>
														</div>
													</div>
													<div style="width: 100%;">
														<div style="text-align: center;margin-top: 12px;">
															<span style="float: left;color: red;">*双击选中行 </span>
															<button type="button" class="btn btn-default" id="gaiconfirm" style="margin-right: 20px;position: absolute;bottom: 5px;left: 45%;">确定</button>
															<button type="button" class="btn btn-default" id="gaicancel" data-dismiss="modal" style="position: absolute;bottom: 5px;left: 50%;">取消</button>
														</div>
													</div>
										</div>
									</form>
									</div>
								</div>
							</div>
						</div>
						<!-- 改制模态框 end       -->   
						<!-- 打印模态框 start -->
						<div class="modal fade " id="printModal" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="background-color: rgba(0, 0, 0, 0.5)" data-backdrop="static">
							<div class="modal-dialog" style="width: 90%;">
								<div class="modal-content" style="width: auto;">
									<div class="modal-header">
										<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
										<h4 class="modal-title" id="myModal">派工详情</h4>
									</div>
									<div class="modal-body" style="height: auto; padding: 10px;">
										<div style="margin-bottom: 5px;">
											<!-- <div style="float:left">
												<span class="spanCss">员工号：</span> 
												<input type="text" id="fNumber" name="fNumber" class="form-control clean_C" style="width: 150px; margin-right: 10px;" /> 
												<span class="spanCss">员工姓名：</span> 
												<input type="text" id="fName" name="fName" class="form-control clean_C" style="width: 150px; margin-right: 10px;" /> 
											</div>
											<div style="float:left">
												<button id="query" class="btn btn-default " type="button" style="margin-left: 10px;">查询</button>
												<button type="button" class="btn btn-default " id="resetting">重置</button>
											</div> -->
											<div style="float:left;">
												<button id="printNullPies" class="btn btn-default " type="button" style="margin-left: 10px;">打印空派工单</button>
											</div>
											<div style="clear:both"></div>
										</div>
										<div>
											<table id="printTable" class="table dataTable table-hover">
											</table>
										</div>
									</div>
								</div>
							</div>
						</div>
						<!-- 打印模态框 end -->
						
						<!-- 调用showModal里的queryModal，查询行 -->
						<div th:include="Production/showModal :: queryModal" />
						<div th:include="Production/customColumnModal :: customColumnModal" /></div>    
					</div>
				</div>
			</div>
		</div>
	</div>
	<span id="value" style="display: none;">1</span>
	<div th:include="base :: bottom" />
	<div th:include="base :: bootstrapTable" />
	<div th:include="base :: bootstrapTable-eidt" />
	<div th:include="base :: others" />
	<div th:include="base :: ztree" />
	<!-- 车间下拉框公共js -->
	<script th:src="@{js/Production/productionPublic.js}"></script>
	<script th:src="@{js/Production/pies.js}"></script>
	<script th:src="@{js/Production/showModal.js}"></script>
	<script th:src="@{js/TaiZhang/productionCommon.js}"></script>
</body>
</html>
